<template>
    <svg class="icon" aria-hidden="true" :style="{ fontSize: `${size}`, color: `${color}` }">
        <use :xlink:href="name"></use>
    </svg>
</template>

<script setup>
import './iconfont.js'
const props = defineProps({
    size: {
        type: String,
        default: '16px',
    },
    color: {
        type: String,
        default: '#fff',
    },
    icon: {
        type: String,
        default: 'fanhui1'
    }
})

const name = computed(() => {
    return `#icon-${props.icon}`
})

</script>

<style scoped lang="scss">
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}
</style>